ci: build wheel with compiled frontend and attach to release#2
Merged
Conversation
Installing this fork by git rev never runs the Vite build, so the compiled frontend (explorer/static/) is absent from the installed package and every /static/explorer/* asset 404s in production. Add a release-triggered workflow that builds the frontend and a wheel, then attaches the wheel (+ sdist) as a release asset. Consumers install the release-asset wheel, so built static ships inside the package and no Node/Vite toolchain is needed at install or deploy time. The workflow fails loudly if APP_VERSION is empty (which silently produces main..js) or if the wheel lacks the built static. Remove publish-pypi.yml: it published to the upstream public PyPI project on every release, which is wrong for this fork and would also fire on the releases this new workflow depends on. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The admin site serves SQL Explorer's frontend from
/static/explorer/*(e.g.
main.5.3.js,styles.css,bootstrap-icons.woff2,logo-main.svg).In production every one of these 404s.
Root cause
This package is consumed by git rev (
django-sql-explorer @ git+…@5.3.0-scrub-hook).Explorer 5.x has a Vite-built frontend whose compiled output lands in
explorer/static/explorer/— which is gitignored (it's a build artifact).A git-rev install runs the Python build backend only; it never runs
npm run build.So the installed package contains just
explorer/src/(un-built source),collectstaticfinds nothing under
explorer/, and nginx returns 404 for every asset.The packaging is already correct —
MANIFEST.in(recursive-include explorer *) +include_package_data=Truebundle the built static into the wheel. The only missingpiece is that the frontend must be built before the package is built, which a git-rev
install skips.
Fix
Add
release-wheel.yml: on a published GitHub Release, set up Node from.nvmrc,npm ci→npm run build→python -m build, then attach the wheel (+ sdist) as arelease asset. Consumers install that wheel directly, so the built static ships inside
the package and no Node/Vite toolchain is needed at install or deploy time.
Guards included (this build has a silent-failure mode):
APP_VERSIONis empty the Vite build emitsmain..jsand still exits 0 — theworkflow now fails if
main.<version>.jsis absent.Also removes
publish-pypi.yml: it published to the upstream public PyPI projecton every release — wrong for this fork, and it would otherwise fire on the same
release: publishedevent this workflow relies on.Verification (built locally from this branch's code)
After merge
5.3.0-scrub-hook→ this workflow builds the wheel on thepinned Node 20 and attaches it.
voicebot-enginefrom the git-rev pin to the release-asset wheel URL (separate PR).🤖 Generated with Claude Code